<template>
    <div class="Login">
        <div class="login-box">
            <div class="img-box logo wid">
                <img src="../assets/images/logo.png" alt="" srcset="">
            </div>
            <div class="logo-info wid">
                <ul class="user-num">
                    <li>
                        <input type="text" v-model="UserName" placeholder="用户名（admin）">
                    </li>
                    <li>
                        <input type="text" v-model="UserPwd"
                        placeholder="密码（admin）">
                    </li>
                </ul>  
                <button class="login-btn" @click="login()">立即登录</button>
                <ul class="user-icon clearfix">
                    <li>
                        <img src="../assets/images/login-icon1.png" alt="" srcset="">
                    </li>
                       <li>
                        <img src="../assets/images/login-icon2.png" alt="" srcset="">
                    </li>
                       <li>
                        <img src="../assets/images/login-icon3.png" alt="" srcset="">
                    </li>
                </ul>
            </div>
        </div>
    </div>
</template>
<script>
import { Toast } from 'vant'
export default {
    data(){
        return {
            UserName:'',
            UserPwd:''
        }
    },
    methods:{
        login(){
            if(this.UserName === '' || this.UserPwd === ''){
                Toast('用户名或者密码不能为空')
            }else if(this.UserName != 'admin' && this.UserPwd != 'admin'){
                Toast('用户名或者密码不正确（admin）')
            }else{
                this.$router.push('/user')
                Toast('登录成功')
            }
        }
    }
}
</script>